#ifndef MEDIAPLAYERVIDEO_H
#define MEDIAPLAYERVIDEO_H

#include <QMainWindow>
#include <QMediaPlayer>

QT_BEGIN_NAMESPACE
namespace Ui { class MediaPlayerVideo; }
QT_END_NAMESPACE

class MediaPlayerVideo : public QMainWindow
{
    Q_OBJECT

public:
    MediaPlayerVideo(QWidget *parent = nullptr);
    ~MediaPlayerVideo();

private slots :
    //自定义槽函数
    void onStateChanged (QMediaPlayer::State state) ;
    void onDurationChanged(qint64 duration);
    void onPositionChanged(qint64 position);

private slots:
    //UI 设计器自动关联的槽函数
    void on_btnOpenFile_clicked();

    void on_btnPlay_clicked();

    void on_btnPause_clicked();

    void on_btnStop_clicked();

    void on_sliderVolumn_valueChanged(int value);

    void on_btnSound_clicked();

    void on_sliderPosition_valueChanged(int value);

    void on_btnFullScreen_clicked();

private:
    Ui::MediaPlayerVideo *ui;

    QMediaPlayer * m_Player = nullptr;  //视频播放器
    QString m_durationTime ; //播放时长
    QString m_positionTime ; //播放位置时间，快进
};
#endif // MEDIAPLAYERVIDEO_H
